package com.itdao.dp.strategy.account;

import com.itdao.dp.strategy.account.holder.Account;
import com.itdao.dp.strategy.account.holder.EmailAccount;
import com.itdao.dp.strategy.account.holder.MobileAccount;

import java.util.HashMap;
import java.util.Map;

public class AppTest {

    public static Map<String, Account> accountMap = new HashMap<String, Account>() {
        {
            put(MobileAccount.class.getName(), new MobileAccount());
            put(EmailAccount.class.getName(), new EmailAccount());
        }
    };

    public static void main(String[] args) {
        Account mobileAccount = accountMap.get(MobileAccount.class.getName());
        mobileAccount.login("15912348888", "123456");
        mobileAccount.register("15912348888", "123456");
        mobileAccount.reset("15912348888", "123456");

        System.out.println("-----------------------------");

        Account emailAccount = accountMap.get(EmailAccount.class.getName());
        emailAccount.login("admin@126.com", "123456");
        emailAccount.register("admin@126.com", "123456");
        emailAccount.reset("admin@126.com", "123456");
    }
}
